let path = require('path')
function resolve (dir) {
  return path.join(__dirname, dir)
}
// 引入等比适配插件
const px2rem = require('postcss-px2rem')

// 配置基本大小
const postcss = px2rem({
  // 基准大小 baseSize，需要和rem.js中相同
  remUnit: 100
})
module.exports = {
  publicPath: "./",
  outputDir: process.env.VUE_APP_FOLDER,
  productionSourceMap: false,
  lintOnSave: false,
  chainWebpack: (config) => {
    config.resolve.alias.set("@", resolve("src"))
  },
  devServer: {
    // development server port 8000
    port: 8000,
    proxy: {
      "/testApi": {
        target: process.env.VUE_APP_BASE_URL,
        ws: true,
        changeOrigin: true,
        logLevel:"debug",
        pathRewrite: {
          "^/testApi": ""
        }
      }
    }
  }
}